refactor(coin-evm): remove some dead code#14854
refactor(coin-evm): remove some dead code#14854francois-guerin-ledger wants to merge 1 commit intodevelopfrom
Conversation
bea316f to
0b38978
Compare
| ); | ||
| }); | ||
|
|
||
| it("should return 0 for invalid transaction", async () => { |
There was a problem hiding this comment.
Already covered by gives 0 additional fees if the transaction is not serializable
| ); | ||
| }); | ||
|
|
||
| it("should return 0 for invalid transaction", async () => { |
There was a problem hiding this comment.
Already covered by gives 0 additional fees if the transaction is not serializable
| getOptimismAdditionalFees: (currency: CryptoCurrency, transaction: string) => Promise<BigNumber>; | ||
| getScrollAdditionalFees: (currency: CryptoCurrency, transaction: string) => Promise<BigNumber>; |
There was a problem hiding this comment.
transaction is only passed as string in production code
There was a problem hiding this comment.
Pull request overview
Refactors the coin-evm module by removing unused/publicly unreferenced code paths and updating Layer2 additional-fee computation to work with serialized transactions, with corresponding test and docs cleanup.
Changes:
- Remove dead exports/types/helpers (ERC20 tuple type, ethers adapter, transaction serialization/data helpers, various logic helpers/errors).
- Update Optimism/Scroll additional-fee APIs to accept a serialized transaction string and adjust tests accordingly.
- Prune/update documentation to match the reduced public surface.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/coin-modules/coin-evm/src/types/ledger.ts | Removes unused ledger explorer block type. |
| libs/coin-modules/coin-evm/src/types/index.ts | Stops re-exporting the erc20 types module. |
| libs/coin-modules/coin-evm/src/types/erc20.ts | Deletes the legacy ERC20Token tuple type. |
| libs/coin-modules/coin-evm/src/transaction.ts | Removes smart-contract calldata + tx serialization helpers. |
| libs/coin-modules/coin-evm/src/transaction.test.ts | Drops tests tied to removed transaction helpers/adapters. |
| libs/coin-modules/coin-evm/src/network/node/types.ts | Narrows additional-fee APIs to accept serialized tx strings only. |
| libs/coin-modules/coin-evm/src/network/node/rpc.test.ts | Updates tests to pass serialized ethers transactions. |
| libs/coin-modules/coin-evm/src/network/node/rpc.common.ts | Removes internal serialization path; uses serialized tx string directly. |
| libs/coin-modules/coin-evm/src/network/node/ledger.ts | Removes internal serialization path; uses serialized tx string directly. |
| libs/coin-modules/coin-evm/src/network/node/ledger.test.ts | Updates tests to pass serialized ethers transactions. |
| libs/coin-modules/coin-evm/src/logic/estimateFees.test.ts | Renames a test description to “serializable”. |
| libs/coin-modules/coin-evm/src/logic.ts | Removes several unused helpers and narrows additional-fee helper signature. |
| libs/coin-modules/coin-evm/src/logic.test.ts | Removes tests for deleted helpers. |
| libs/coin-modules/coin-evm/src/errors.ts | Removes unused custom error classes. |
| libs/coin-modules/coin-evm/src/adapters/index.ts | Stops exporting the ethers adapter module. |
| libs/coin-modules/coin-evm/src/adapters/ethers.ts | Deletes the ethers transaction adapter. |
| libs/coin-modules/coin-evm/src/adapters/ethers.test.ts | Deletes tests for the removed ethers adapter. |
| libs/coin-modules/coin-evm/docs/transaction.md | Removes docs for deleted transaction helpers. |
| libs/coin-modules/coin-evm/docs/logic.md | Removes docs for deleted logic helpers; minor formatting alignment. |
| libs/coin-modules/coin-evm/docs/adapters.md | Removes docs for deleted ethers adapter. |
| .changeset/lazy-mayflies-itch.md | Adds a patch changeset for the refactor. |
Comments suppressed due to low confidence (1)
libs/coin-modules/coin-evm/src/transaction.ts:206
- This module removes previously exported helpers (
getTransactionData,getSerializedTransaction). Even if currently unused in this repo, they were part of the public@ledgerhq/coin-evm/transactionAPI, so this is a breaking change for any downstream consumer. Consider keeping deprecated wrappers for one release (or ensure the changeset/semver bump matches a breaking change).
return txRaw as EvmTransactionRaw;
};
/**
* Returns a transaction with the correct type and entries depending
* on the network compatiblity.
*/
export const getTypedTransaction = (
_transaction: EvmTransaction,
0b38978 to
fa38757
Compare
|
qperrot
left a comment
There was a problem hiding this comment.
Do not forget to run e2e tests
|
|
fa38757 to
a74569e
Compare
a74569e to
d2146bc
Compare
d2146bc to
6a992d6
Compare
| it("should return 0 if the currency isn't optimism", async () => { | ||
| expect( |
There was a problem hiding this comment.
This test is in the getScrollAdditionalFees suite but the description says "currency isn't optimism". Please rename it to refer to Scroll to keep intent clear and avoid confusion when scanning test output.
6a992d6 to
2e1d372
Compare
|




✅ Checklist
npx changesetwas attached.📝 Description
Remove some dead code on coin evm
❓ Context
🧐 Checklist for the PR Reviewers